class Fish{
	int weight;
}
class Lake{
	Fish fish;
	void setFish(Fish s){
		fish = s;
	}
	void eat(int n){
		fish.weight = fish.weight + n;
	}
}
class FishandLake{
	public static void main(String[] args) {
		Fish shiyanyu = new Fish();		//创建对象shiyanyu（实验鱼）
		System.out.println("实验鱼初始重量:"+shiyanyu.weight+"\n");
		Lake taihu  = new Lake();		//创建Lake类对象taihu(太湖)
		Lake dongtinghu  = new Lake();		//创建Lake类对象dongtinghu(洞庭湖)
		Lake panyanghu  = new Lake();		//创建Lake类对象panyanghu(潘阳湖)
		taihu.setFish(shiyanyu);		//将实验鱼放到太湖中
		dongtinghu.setFish(shiyanyu);		//将实验鱼放到洞庭湖中
		panyanghu.setFish(shiyanyu);		//将实验鱼放到潘阳湖中

		System.out.println("给太湖里的鱼喂食15");
		taihu.eat(15);		//给太湖里的鱼喂食15
		System.out.println("此时实验鱼重量:"+shiyanyu.weight);
		System.out.println("太湖中鱼重量:"+taihu.fish.weight);
		System.out.println("洞庭湖中鱼重量:"+dongtinghu.fish.weight);
		System.out.println("潘阳湖中鱼重量:"+panyanghu.fish.weight+"\n");
		System.out.println("给洞庭湖里的鱼喂食30");
		dongtinghu.eat(30);		//给洞庭湖里的鱼喂食30
		System.out.println("此时实验鱼重量:"+shiyanyu.weight);
		System.out.println("太湖中鱼重量:"+taihu.fish.weight);
		System.out.println("洞庭湖中鱼重量:"+dongtinghu.fish.weight);
		System.out.println("潘阳湖中鱼重量:"+panyanghu.fish.weight+"\n");
		System.out.println("给潘阳湖里的鱼喂食50");
		panyanghu.eat(50);		//给潘阳湖里的鱼喂食50
		System.out.println("此时实验鱼重量:"+shiyanyu.weight);
		System.out.println("太湖中鱼重量:"+taihu.fish.weight);
		System.out.println("洞庭湖中鱼重量:"+dongtinghu.fish.weight);
		System.out.println("潘阳湖中鱼重量:"+panyanghu.fish.weight);
	}
}


